Skip to content

Move schema/ConfigurationSchema.json under the Generated folder#10271

Merged
JoshLove-msft merged 7 commits intomainfrom
copilot/move-schema-configurationjson-generated-folder
Apr 6, 2026
Merged

Move schema/ConfigurationSchema.json under the Generated folder#10271
JoshLove-msft merged 7 commits intomainfrom
copilot/move-schema-configurationjson-generated-folder

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Moves the generated ConfigurationSchema.json from schema/ to Generated/schema/ in the output directory, aligning it with the existing Generated/ folder convention for auto-generated artifacts. Also skips schema generation when a custom ConfigurationSchema.json is detected at schema/ConfigurationSchema.json.

  • ScmCodeModelGenerator.cs: Output path changed to Generated/schema/ConfigurationSchema.json; added early return to skip generation when a custom schema exists at schema/ConfigurationSchema.json
  • NewProjectScaffolding.cs: Updated pack item path to Generated/schema/ConfigurationSchema.json; guarded pack items (schema + .targets) with a custom schema check so they are only added when no custom schema/ConfigurationSchema.json exists
  • Test projects: All 72 test projects regenerated via Generate.ps1; schema files moved, .csproj references updated

Updated the generator to write ConfigurationSchema.json to Generated/schema/
instead of schema/. Updated NewProjectScaffolding pack item references and
regenerated all test projects.

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/885ca9bd-de06-4816-8b31-55b8342c3c46

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Apr 4, 2026
Copilot AI changed the title [WIP] Move ConfigurationSchema.json under the Generated folder Move schema/ConfigurationSchema.json under the Generated folder Apr 4, 2026
Copilot AI requested a review from JoshLove-msft April 4, 2026 04:38
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 5, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@10271

commit: fcd41ca

@JoshLove-msft
Copy link
Copy Markdown
Contributor

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

When a custom ConfigurationSchema.json is detected at schema/ConfigurationSchema.json
(outside the Generated folder), the generator now skips generating the schema and
.targets files. NewProjectScaffolding also checks the custom path first for pack items.

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/6cd1df1d-4044-4894-abb7-7c77d70b9a50

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

Added in 3e82ed4. WriteAdditionalFiles now checks for a custom schema/ConfigurationSchema.json and returns early if found. NewProjectScaffolding also checks the custom path first for .csproj pack items, falling back to the Generated/schema/ path.

@JoshLove-msft
Copy link
Copy Markdown
Contributor

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

Added in 3e82ed4. WriteAdditionalFiles now checks for a custom schema/ConfigurationSchema.json and returns early if found. NewProjectScaffolding also checks the custom path first for .csproj pack items, falling back to the Generated/schema/ path.

NewProjectScaffolding doesn't have to handle the custom path. If there is a custom path then NewProjectScaffolding would not be executing. @copilot

Per review feedback: NewProjectScaffolding doesn't need to handle the
custom schema path since it wouldn't be executing when a custom schema
exists.

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/9eb66940-80a6-42d3-b9c1-78eacaa4d459

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

Added in [3e82ed4](3e82ed4...

Reverted NewProjectScaffolding.cs to its original state in 430ffb9. The custom path handling has been removed — only ScmCodeModelGenerator.cs checks for the custom schema to skip generation.

@JoshLove-msft
Copy link
Copy Markdown
Contributor

@copilot run Generate.ps1

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot run Generate.ps1

Updated the location check in NewProjectScaffolding.cs to use Generated/schema/ConfigurationSchema.json and re-ran Generate.ps1 — all tests pass in 220d3a5.

…generated

Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/100fa1fc-602a-41ef-a835-888bd1dfd935

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 6, 2026

@copilot run Generate.ps1

Re-ran Generate.ps1 — all tests pass in fcd41ca.

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

This is implemented in ScmCodeModelGenerator.WriteAdditionalFiles — it checks for schema/ConfigurationSchema.json and returns early if found. NewProjectScaffolding now also skips adding the generated schema pack items when a custom schema exists (fcd41ca).

@copilot if we detect a custom ConfigurationSchema.json we should skip generating the schema.

Added in [3e82ed4](3e82ed4...

Updated in fcd41caNewProjectScaffolding no longer has custom path fallback logic. It only checks if a custom schema exists to decide whether to add the generated schema pack items.

@JoshLove-msft JoshLove-msft added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit 457ea8c Apr 6, 2026
29 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/move-schema-configurationjson-generated-folder branch April 6, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move schema/ConfigurationSchema.json under the Generated folder

3 participants